
/// 			WHAT DOES THE POPULATION IN NIGER THINK ABOUT A MILITARY GOVERNMENT?
//								Daniel Tuki

*The question numbers upon which the variables are based (i.e., in the Afrobarometer dataset/survey instrument) are specified in square parenthesis; the variable names are specified in normal parenthesis. 


///					OPERATIONALIZATION OF THE VARIABLES

***		Dependent variables

// Military intervention (mili_intervene) [Q29B]: This measures the degree to which respondents agree with a statement about Niger's military intervening when the democratic government is corrupt.
gen mili_intervene = Q29B
*To treat respondents (n = 12) who chose the "don't know" response category as missing: 
replace mili_intervene = . if mili_intervene == 9

*To treat respondents (n = 17) who agreed with neither of the two statements as missing observations: 
replace mili_intervene = . if mili_intervene == 5


// Military intervention binary (bin_mili_intervene): This is a reduced form of the explanatory variable in which I code responses in support of the intervention as 1 and responses in opposition to it as 0. 
gen bin_mili_intervene = . 
replace bin_mili_intervene = 1 if mili_intervene == 4
replace bin_mili_intervene = 1 if mili_intervene == 3
replace bin_mili_intervene = 0 if mili_intervene == 2
replace bin_mili_intervene = 0 if mili_intervene == 1



***		Explanatory variables

// Socioeconomic deprivation index (deprive_index) (Q6A-E): This is an additive index that measures the frequency with which respondents or members of their households, during the past year, have gone without food (Q6A), drinking water (Q6B), medication when sick (Q6C), Fuel to cook food (Q6D), and cash income (Q6E). 

*Frequency of going without food
gen food = Q6A

*Frequency of going without drinking water
gen water = Q6B

*Frequency of going without medicine or medical care
gen medicine = Q6C

*Frequency of going without fuel to cook food
gen fuel = Q6D
*To treat "don't know" responses as missing:
replace fuel = . if fuel == 9

*Frequency of going without cash income
gen income = Q6E
*To treat "don't know" responses as missing:
replace income = . if income == 9

*To develop an additive indicator that combines these five items:
gen deprive_index = food + water + medicine + fuel + income

*To obtain the Cronbach Alpha statistic for these five items
alpha food water medicine fuel income

*To plot the deprivation index on a histogram [Figure 6]
histogram deprive_index, freq


// Corruption index (ind_corrupt) (Q38A, Q38B, and Q38F): This is an additive indicator that measures the extent to whcih respondents perceive corruption in the executive, legislative, and judiciary arms of the government. 

*Corruption in the presidency:
gen pres_corrupt = Q38A
*To treat "don't know" and "refused to answer" responses as missing:
replace pres_corrupt = . if pres_corrupt > 3

*Corruption in national assembly
gen assem_corrupt = Q38B
*To treat "don't know" and "refused to answer" responses as missing:
replace assem_corrupt = . if assem_corrupt > 3

*Corruption in judiciary
gen judge_corrupt = Q38F
*To treat "don't know" and "refused to answer" responses as missing:
replace judge_corrupt = . if judge_corrupt > 3

*To generate an additive indicator for corruption in the three tiers of government (ind_corrupt):
gen ind_corrupt = pres_corrupt + assem_corrupt + judge_corrupt

*To determine the internal reliability of these three items (Cronbach alpla: 0.76)
alpha pres_corrupt assem_corrupt judge_corrupt


// Political instability (vio_97_21): This measures the total number of violent conflict incidents in the region where the respondents reside from 1997 to 2021. This variable is based on data obtained from the Armed Conflict Location and Events Database (ACLED) (Raleigh et al. 2010). The ACLED data can be accessed here: https://acleddata.com/



***		Control variables

// Age [Q1]: This indicates how old respondents are in years. 
gen age = Q1

// Gender (gender) [Q100]: This is a dummy variable that takes the value of 1 if the respondent is male and 0 if female
gen gender = Q100
*To code females as 0, since males are already coded as 1: 
replace gender = 0 if gender == 2

// Educational level (educ) [Q94]: This measures the highest level of education attained by the respondents on a scale with ten ordinal categories: 
gen educ = Q94 

// Nighttime light (night_2020mean): This measures the mean nighttime light in the region where the respondent resides for the year 2020. I computed this variable using QGIS software because the raw dataset is gridded. To obtain the nighttime light dataset, visit: https://eogdata.mines.edu/products/dmsp/

// Ethnic group (ethnic) [Q84]: This indicates the ethnic group to which the respondent belongs.
gen ethnic = Q84A

// Region [REGION]: This is a unique numerical code for the region where the respodent resides. 
tab REGION
codebook REGION

// Trust in military (trust_mil): This measures the degree to whcih the population trusts the military. 
gen trust_mil = Q37H
*To treat "don't know" and "refused to answer" responses as missing:
replace trust_mil = . if trust_mil > 3


***		Descriptive variables

*These are variables that I referred to only descriptively in the introduction of the paper. 

*Country's economic situation (economy) [Q4A]: This measures the respondents' assessment of the present styate of the Nigerien economy. 
gen economy = Q4A
tab economy

*Personal living conditon (live_cond) [Q4B): This measures the respondents' assessment of their present living conditions. 
gen live_cond = Q4B
tab live_cond

*Relative economic condition (rel_economy) [Q5A]: This measures the respondents' assessment of the Niger's economy compared to 12 months ago. 
gen rel_economy = Q5A
tab rel_economy

*Frequency with which respondents have gone without food [based on Q6A]
tab food

*No of Nigeriens who have no education 
tab educ




//					REGRESSION MODELS

// Table 1: Correlates of support for military intervention

*Model 1: Corruption only 
regress mili_intervene ind_corrupt, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 2: Deprivation only
regress mili_intervene deprive_index, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 3: Political instability only
regress mili_intervene vio_97_21, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 4: Adding all explanatory variables in the same model
regress mili_intervene ind_corrupt deprive_index vio_97_21, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 5: Adding control variables
regress mili_intervene ind_corrupt deprive_index vio_97_21 trust_mil age gender educ night_2020mean, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 6: Adding fixed effects for ethnicity and region
regress mili_intervene ind_corrupt deprive_index vio_97_21 trust_mil age gender educ night_2020mean i.ethnic i.REGION, vce(cluster REGION)
*To obtain the AIC statistic
estat ic

*Model 7: Using LPM as an alternative estimation method - with binary dependent variable
regress bin_mili_intervene ind_corrupt deprive_index vio_97_21 trust_mil age gender educ night_2020mean i.ethnic i.REGION, vce(cluster REGION)
*To obtain the AIC statistic
estat ic




//							APPENDIX

* SECTION A: 

* Table A1: Descriptive statistics
summ mili_intervene bin_mili_intervene ind_corrupt deprive_index vio_97_21 trust_mil age gender educ night_2020mean 
 

* Table A2: Models using the Urban and Rural subsamples of respondents

*Urban-Rural (URBRUR): Takes a value of 1 if the respondent resides in an urban center and 0 if he/she resides in a rural area.  

*Model 1: Urban subsample
regress mili_intervene deprive_index, vce(cluster REGION), if URBRUR == 1

*Model 2: Rural subsample
regress mili_intervene deprive_index, vce(cluster REGION), if URBRUR == 2




